//
//  Some1ViewController.m
//  YXKitOC
//
//  Created by 李鹏飞 on 2020/1/20.
//  Copyright © 2020 张鑫. All rights reserved.
//

#import "ViewController3.h"
#import "ViewController2.h"
#import "YXKitOC.h"
//#import "YXDictionaryFilterView.h"
#import "TestSegmentMenuMainVC.h"
#import "JXCategoryTitleView.h"
#import "JXCategoryIndicatorLineView.h"
//#import "YXImagePicker.h"

@interface ViewController3 ()

//@property (nonatomic, strong) YXMenuFilterManager *menuFilterManager; /**< 筛选条组合控件 */

//@property (strong, nonatomic) YXDictionaryFilterView *filter1, *filter2, *filter3;

//@property (nonatomic, strong) YXImagePicker *imagePicker; /**<  相册摄像头*/
@end

@implementation ViewController3

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
//    UIButton *btn = [UIButton yx_creatWithMinX:100 minY:300 title:@"开启侧滑" fontSize:19 titleColor:nil block:^(id  _Nonnull sender) {
//        [self func:sender];
//    }];
//    UIButton *btn1 = [UIButton yx_creatWithMinX:100 minY:350 title:@"头条菜单" fontSize:19 titleColor:nil block:^(id  _Nonnull sender) {
//        [self func1:sender];
//    }];
//    
//    UIButton *btn2 = [UIButton yx_creatWithMinX:100 minY:400 title:@"相机" fontSize:19 titleColor:nil block:^(id  _Nonnull sender) {
//        [self func2:sender];
//    }];
//    UIButton *btn3 = [UIButton yx_creatWithMinX:100 minY:450 title:@"相册" fontSize:19 titleColor:nil block:^(id  _Nonnull sender) {
//        [self func3:sender];
//    }];
//    [self.view addSubview:btn];
//    [self.view addSubview:btn1];
//    [self.view addSubview:btn2];
//    [self.view addSubview:btn3];
//    [self.menuFilterManager reloadData];
}
//- (void)func:(UIButton *)sender {
//    ViewController2 *vc = [[ViewController2 alloc] init];
//    [self.navigationController yx_pushViewController:vc];
//}
//- (void)func1:(UIButton *)sender {
//    TestSegmentMenuMainVC *vc = [[TestSegmentMenuMainVC alloc] init];
//    vc.title = @"分段菜单";
//    vc.hidesBottomBarWhenPushed = YES;
//    JXCategoryTitleView *titleCategoryView = (JXCategoryTitleView *)vc.categoryView;
//    titleCategoryView.titleSelectedColor = [UIColor blueColor];
//    titleCategoryView.backgroundColor = [UIColor whiteColor];
//    vc.isNeedIndicatorPositionChangeItem = YES;
//    titleCategoryView.titleColorGradientEnabled = YES;
//    JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
//    lineView.indicatorWidth = JXCategoryViewAutomaticDimension;
//    lineView.indicatorColor = [UIColor blueColor];
//    //可以试试宽度补偿
//    //        lineView.indicatorWidthIncrement = 10;
//    titleCategoryView.indicators = @[lineView];
//    [self.navigationController yx_pushViewController:vc];
//}
//- (void)func2:(UIButton *)sender {
////    self.imagePicker = [[YXImagePicker alloc] init];
////    [self.imagePicker showCaptureInParent:self imagePickerType:YXImagePickerTypeCamera maxPhotoCount:10 handler:^(NSArray<UIImage *> * _Nonnull images) {
////
////    }];
//}
//
//- (void)func3:(UIButton *)sender {
////    self.imagePicker = [[YXImagePicker alloc] init];
////    [self.imagePicker showCaptureInParent:self imagePickerType:YXImagePickerTypeAlbum maxPhotoCount:10 handler:^(NSArray<UIImage *> * _Nonnull images) {
////
////    }];
//}
//
//#pragma mark - YXMenuFilterManagerDataSource
//
///// 添加筛选管理器步骤6，添加YXMenuFilterManagerDataSource
//- (NSArray *)titlesOfFilterInYXMenuFilterManager:(YXMenuFilterManager *)menuFilterManager {
//    return @[@"筛选1", @"筛选2", @"筛选3"];
//}
//
//- (UIView<YXMenuFilterProtocol> *)viewOfFilterInYXMenuFilterManager:(YXMenuFilterManager *)menuFilterManager index:(NSInteger)index {
//    return nil;
//}
//
///// 添加YXMenuFilterManagerDataSource
//#pragma mark - YXMenuFilterManagerDelegate
//
///// 已选筛选条件导致已选筛选条高度发生变化时的代理
//- (void)menuFilterManager:(YXMenuFilterManager *)menuFilterManager filtersShowViewHeightDidUpdate:(CGFloat)filtersShowViewHeight {
//
//}
//
///// 已选筛选条件代理
//- (void)menuFilterManager:(YXMenuFilterManager *)menuFilterManager didChangedFilterObjects:(NSArray<YXFilterObject *> *)objects filterPage:(UIView *)filterPage filterPageIndex:(NSInteger)filterPageIndex {
//    for (YXFilterObject *obj in objects) {
//        if (filterPageIndex == 0) {
//            if ([obj.key isEqualToString:@"dictionaryFilterKey"]) {
//
//            }
//        } else if (filterPageIndex == 1) {
//            if ([obj.key isEqualToString:@"dictionaryFilterKey"]) {
//
//            }
//        } else if (filterPageIndex == 2) {
//            if ([obj.key isEqualToString:@"dictionaryFilterKey"]) {
//
//            }
//        }
//    }
//}
//
//
//- (NSArray *)getDataSource
//{
//    return @[
//    @{ @"content" : @"待提交1",
//       @"key" : @(101) },
//    @{ @"content" : @"待提交预审",
//       @"key" : @(105) },
//    @{ @"content" : @"四要素拒绝",
//       @"key" : @(1051) },
//    @{ @"content" : @"预审拒绝",
//       @"key" : @(1052) },
//    @{ @"content" : @"待完善",
//       @"key" : @(2000) },
//    @{ @"content" : @"审核中",
//       @"key" : @(3000) },
//    @{ @"content" : @"风控通过前合同取消",
//       @"key" : @(3100) },
//    @{ @"content" : @"电核退回",
//       @"key" : @(3200) },
//    @{ @"content" : @"合同已拒绝",
//       @"key" : @(3300) },
//    @{ @"content" : @"待收三方服务费",
//       @"key" : @(3310) },
//    @{ @"content" : @"月结",
//       @"key" : @(3311) },
//    @{ @"content" : @"已收款",
//       @"key" : @(3312) },
//    @{ @"content" : @"待签约",
//       @"key" : @(4000) },
//    @{ @"content" : @"合同审核中",
//       @"key" : @(5000) },
//    @{ @"content" : @"风控后合同取消",
//       @"key" : @(5900) },
//    @{ @"content" : @"待垫资",
//       @"key" : @(6000) },
//    @{ @"content" : @"垫资中",
//       @"key" : @(6010) },
//    @{ @"content" : @"已垫资",
//       @"key" : @(6100) },
//    @{ @"content" : @"已完成",
//       @"key" : @(7000) },
//    @{ @"content" : @"已生效合同，当月取消",
//       @"key" : @(7900) }
//    ];
//}
//
//- (NSArray *)getDataSource2
//{
//    return @[
//    @{ @"content" : @"待提交2",
//       @"key" : @(101) },
//    @{ @"content" : @"待提交预审",
//       @"key" : @(105) },
//    @{ @"content" : @"四要素拒绝",
//       @"key" : @(1051) },
//    @{ @"content" : @"预审拒绝",
//       @"key" : @(1052) },
//    @{ @"content" : @"待完善",
//       @"key" : @(2000) },
//    @{ @"content" : @"审核中",
//       @"key" : @(3000) },
//    @{ @"content" : @"风控通过前合同取消",
//       @"key" : @(3100) },
//    @{ @"content" : @"电核退回",
//       @"key" : @(3200) },
//    @{ @"content" : @"合同已拒绝",
//       @"key" : @(3300) },
//    @{ @"content" : @"待收三方服务费",
//       @"key" : @(3310) },
//    @{ @"content" : @"月结",
//       @"key" : @(3311) },
//    @{ @"content" : @"已收款",
//       @"key" : @(3312) },
//    @{ @"content" : @"待签约",
//       @"key" : @(4000) },
//    @{ @"content" : @"合同审核中",
//       @"key" : @(5000) },
//    @{ @"content" : @"风控后合同取消",
//       @"key" : @(5900) },
//    @{ @"content" : @"待垫资",
//       @"key" : @(6000) },
//    @{ @"content" : @"垫资中",
//       @"key" : @(6010) },
//    @{ @"content" : @"已垫资",
//       @"key" : @(6100) },
//    @{ @"content" : @"已完成",
//       @"key" : @(7000) },
//    @{ @"content" : @"已生效合同，当月取消",
//       @"key" : @(7900) }
//    ];
//}
//
//- (NSArray *)getDataSource3
//{
//    return @[
//    @{ @"content" : @"待提交3",
//       @"key" : @(101) },
//    @{ @"content" : @"待提交预审",
//       @"key" : @(105) },
//    @{ @"content" : @"四要素拒绝",
//       @"key" : @(1051) },
//    @{ @"content" : @"预审拒绝",
//       @"key" : @(1052) },
//    @{ @"content" : @"待完善",
//       @"key" : @(2000) },
//    @{ @"content" : @"审核中",
//       @"key" : @(3000) },
//    @{ @"content" : @"风控通过前合同取消",
//       @"key" : @(3100) },
//    @{ @"content" : @"电核退回",
//       @"key" : @(3200) },
//    @{ @"content" : @"合同已拒绝",
//       @"key" : @(3300) },
//    @{ @"content" : @"待收三方服务费",
//       @"key" : @(3310) },
//    @{ @"content" : @"月结",
//       @"key" : @(3311) },
//    @{ @"content" : @"已收款",
//       @"key" : @(3312) },
//    @{ @"content" : @"待签约",
//       @"key" : @(4000) },
//    @{ @"content" : @"合同审核中",
//       @"key" : @(5000) },
//    @{ @"content" : @"风控后合同取消",
//       @"key" : @(5900) },
//    @{ @"content" : @"待垫资",
//       @"key" : @(6000) },
//    @{ @"content" : @"垫资中",
//       @"key" : @(6010) },
//    @{ @"content" : @"已垫资",
//       @"key" : @(6100) },
//    @{ @"content" : @"已完成",
//       @"key" : @(7000) },
//    @{ @"content" : @"已生效合同，当月取消",
//       @"key" : @(7900) }
//    ];
//}
//#pragma mark - Getter
//
///// 初始化YXMenuFilterManager对象，设置代理
//- (YXMenuFilterManager *)menuFilterManager {
//    if (!_menuFilterManager) {
//        _menuFilterManager = [[YXMenuFilterManager alloc] initWithFrame:CGRectMake(0, YX_SafeArea_Top(), self.view.width, self.view.height - self.tabBarController.tabBar.height - YX_SafeArea_Top()) showInView:self.view];
//        _menuFilterManager.dataSource = self;
//        _menuFilterManager.delegate = self;
//    }
//    return _menuFilterManager;
//}

//- (YXDictionaryFilterView *)filter1 {
//    if (!_filter1) {
//        _filter1 = [[YXDictionaryFilterView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.menuFilterManager.customViewHeight)];
//        /// 设置筛选页代理为YXMenuFilterManager对象
//        _filter1.menuFilterDelegate = self.menuFilterManager;
//        _filter1.dataSource = [NSMutableArray arrayWithArray:[self getDataSource]];
//    }
//    return _filter1;
//}
//
//- (YXDictionaryFilterView *)filter2 {
//    if (!_filter2) {
//        _filter2 = [[YXDictionaryFilterView alloc] initWithFrame:CGRectMake(0, 44, self.view.frame.size.width, self.view.bounds.size.height - 44)];
//        /// 设置筛选页代理为YXMenuFilterManager对象
//        _filter2.menuFilterDelegate = self.menuFilterManager;
//        _filter2.dataSource = [NSMutableArray arrayWithArray:[self getDataSource2]];
//    }
//    return _filter2;
//}
//
//- (YXDictionaryFilterView *)filter3 {
//    if (!_filter3) {
//        _filter3 = [[YXDictionaryFilterView alloc] initWithFrame:CGRectMake(0, 44, self.view.frame.size.width, self.view.bounds.size.height - 44)];
//        /// 设置筛选页代理为YXMenuFilterManager对象
//        _filter3.menuFilterDelegate = self.menuFilterManager;
//        _filter3.dataSource = [NSMutableArray arrayWithArray:[self getDataSource3]];
//    }
//    return _filter3;
//}

@end
